//
//  RunHeartDataChartViewModel.swift
//  MoyoungHome
//
//  Created by 易先生 on 2022/9/28.
//

import UIKit
import MYModule
import SwiftDate

open class TrainingChartViewModel: BaseDataChartViewModel {

	public var startTime = ""
	public var endTime = ""
	public var heartInterval: Int64 = 60

    open override func getDefaultTimeString() -> String {
//		let formatter = getCurrentLanguage() == .chinese ? "yyyy年MM月dd日, E" : "yyyy-MM-dd, E"
//		return "\(date.toString(.custom(formatter))), \("continuous_heart_rate_average".language)"
        
        return date.localString
	}

    open override func getSelectedTimeString(with date: Date) -> String {
		let dateFormatter = getCurrentLanguage() == .chinese ? "yyyy年MM月dd日 HH:mm" : "yyyy-MM-dd HH:mm"
		return date.toString(.custom(dateFormatter))
	}

    open override func getCustomSelectDate(_ selectIndex: Int) -> Date {
		return date + (selectIndex * Int(heartInterval)).seconds
	}

    open override func getBarMaxValue() -> Double {
		return 220
	}

    open override func getBarMinValue() -> Double {
		return 0
	}

    open override func getUnitString() -> String {
		return "home_times_min".language
	}
}
